package com.solo.codegen.model.module.req;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 模块新增请求对象 req
 * @author 十一
 * @since 2024-10-18 15:41
 * 人生若只如初见，何事秋风悲画扇
 **/
@Data
public class ModuleCreateReq {

    /**
     * 组织标识
     */
    @NotEmpty(message = "{module.required.groupId}")
    @Size(message = "{module.size.groupId}", max = 64)
    private String groupId;

    /**
     * 项目标识
     */
    @NotEmpty(message = "{module.required.artifactId}")
    @Size(message = "{module.size.artifactId}", max = 32)
    private String artifactId;

    /**
     * 端口
     */
    @NotNull(message = "{module.required.port}")
    private Integer port;

    /**
     * 配置中心地址
     */
    @Size(message = "{module.size.configAddr}", max = 128)
    private String configAddr;

    /**
     * 服务发现地址
     */
    @Size(message = "{module.size.discoveryAddr}", max = 128)
    private String discoveryAddr;

    /**
     * 数据库连接URL
     */
    @Size(message = "{module.size.datasourceUrl}", max = 255)
    private String datasourceUrl;

    /**
     * 数据库用户名
     */
    @Size(message = "{module.size.datasourceUsername}", max = 64)
    private String datasourceUsername;

    /**
     * 数据库密码
     */
    @Size(message = "{module.size.datasourcePassword}", max = 64)
    private String datasourcePassword;

    /**
     * redis地址
     */
    @Size(message = "{module.size.redisHost}", max = 32)
    private String redisHost;

    /**
     * redis端口
     */
    private Integer redisPort;

    /**
     * redis库
     */
    private Integer redisDatabase;

    /**
     * redis密码
     */
    @Size(message = "{module.size.redisPassword}", max = 64)
    private String redisPassword;

    /**
     * 模块描述
     */
    @Size(message = "{module.size.remark}", max = 512)
    private String remark;

}
